package javaDemo06;

import java.util.Scanner;

public class NumberOfTimes {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = 1;
        int num = 0;
        int[] arr = new int[100];
        System.out.println("请输入一百以下的整数，已0结尾");
        while (a != 0) {
            a = sc.nextInt();
            for (int i = num; i <= num; i++) {
                arr[i] = a;
            }
            num++;
        }
        for (int e = 0; e < num - 1; e++) {
            int suber = 1;
            for (int j = e + 1; j < arr.length; j++) {
                if (arr[j] == arr[e]) {
                    arr[j] = 0;
                    suber++;
                }
            }
            if (arr[e] != 0) {
                System.out.println("数字" + arr[e] + "出现了" + suber);
            }
        }

    }
}
